//
//  ZXClassifyViewModel.m
//  XiMaFM
//
//  Created by fanzhuxian on 2017/9/6.
//  Copyright © 2017年 hcios. All rights reserved.
//

#import "ZXClassifyViewModel.h"

#import "ZXClassifyModel.h"
#import "ZxHomePageNetManager.h"

@implementation ZXClassifyViewModel

- (void)getDataCompletionHandle:(void (^)(NSError *))completed {

    self.dataTask = [ZxHomePageNetManager getCategoryPageCompletionHandle:^(ZXClassifyModel *responseObject, NSError *error) {
        self.model = responseObject;
        completed(error);
    }];
}

- (NSInteger)listsCount {

    return  self.model.list.count;
}

///< 图标接口
- (NSURL *)coverURLForIndex:(NSInteger)index {

    NSString * path = self.model.list[index].coverPath;
    return [NSURL URLWithString:path];
}

///< title接口
- (NSString *)titleForIndex:(NSInteger)index {

    return self.model.list[index].title;
}

@end
